package com.hdu.mysql;

public class DynamicDataSourceContextHolder {

    private static final ThreadLocal<DataSourceKey> CONTEXT_HOLDER = new ThreadLocal<>();

    public static void setDataSourceKey(DataSourceKey dataSourceKey) {
        CONTEXT_HOLDER.set(dataSourceKey);
    }

    public static DataSourceKey getDataSourceKey() {
        return CONTEXT_HOLDER.get();
    }
}
